<%@page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%
	String id = request.getParameter("id");
%>
<html>
<head>

<script type="text/javascript">
	var id = <%=id%>;
$(document).ready(function() {
	$("#consumHisInfo-dg").datagrid({
			loadMsg : '数据加载中....',
			width : '100%',
			url : "order/orderList.do?id="+id,
			nowrap : false,
			striped : true,
			sortOrder : 'desc',
			remoteSort : false,
			rownumbers : true,
			pagination : true,
			pageList : [ 10, 15, 20, 25 ],
			fitColumns : true,
			frozenColumns : [ [ {
				field : 'id',
				checkbox : true
			} ] ],
			columns : [ [
					{
						field : 'orderNo',
						title : '订单号',
						width : 300
					},
					{
						field : 'orderTime',
						title : '下单时间',
						width : 100
					},
					{
						field : 'orderAddress',
						title : '下单地点',
						width : 100
					},
					{
						field : 'takeAddress',
						title : '取餐地点',
						width : 100
					},
					{
						field : 'shopName',
						title : '选择商铺',
						width : 100
					},
					{
						field : 'orderDetail',
						title : '订单详情',
						width : 400
					},
					{
						field : 'orderMoney',
						title : '总金额',
						width : 25
					},
					{
						field : 'couponDeduction',
						title : '优惠券抵扣',
						width : 25
					},
					{
						field : 'platformPartion',
						title : '平台抽成',
						width : 25
					},
					{
						field : 'platformProfit',
						title : '平台盈亏',
						width : 25
					},
					{
						field : 'paymentMerchant',
						title : '支付给商家',
						width : 25
					},
					{
						field : 'orderStatus',
						title : '订单状态',
						width : 50,
                        formatter : function(val){
							return orderStatus(val);
                        }
					},
					{
						field : 'refundDetail',
						title : '退款说明',
						width : 200
					}
			] ]
		});// end datagrid
	//设置分页控件
	var p = $('#consumHisInfo-dg').datagrid('getPager');
	$(p).pagination(
				{
					pageSize : 20,//每页显示的记录条数，默认为10
					pageList : [ 20, 25 ],//可以设置每页记录条数的列表
					beforePageText : '第',//页数文本框前显示的汉字
					afterPageText : '页    共 {pages} 页',
					displayMsg : '当前显示 {from} - {to} 条记录   共 {total} 条记录',
					onBeforeRefresh : function() {
						$(this).pagination('loading');
						$(this).pagination('loaded');
					}
				});//end pagination

	}); //end ready

    function exportHis(){
        var pageIndex = $(".pagination-num").val();
        var pageSize = $(".pagination-page-list  option:selected").text();
        var url = "order/exportOrderList.do?id="+id+"&pageIndex=" + pageIndex + "&pageSize="+pageSize;;
        window.open(url);
    }
</script>
</head>
<body>
	<div class="linkbar"><a>用户管理</a>/<a>历史消费</a></div>
	<div class="clear"></div>
	<div id="consumHisInfo-dg" toolbar="#toolbar"></div>
    <div id="toolbar">
	    <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="exportHis()">导出</a>
    </div>
	<div id="dlg-buttons">
		<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="listback('userWeXinInfo/index.do')">返回</a>
	</div>
</body>
</html>